import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)
const routes = [{
  path: '/',
  redirect: '/home/index'
},
{
  path: '/home',
  name: 'home',
  component: () => import(/* webpackChunkName: "home" */ '@/views/home/index.vue'),
  children: [{
    path: '/home/index',
    name: 'index',
    component: () => import(/* webpackChunkName: "index" */ '@/views/home/index/index.vue'),
  }, {
    path: '/home/car',
    name: 'car',
    component: () => import(/* webpackChunkName: "car" */ '@/views/home/car/index.vue'),
  }, {
    path: '/home/my',
    name: 'my',
    component: () => import(/* webpackChunkName: "my" */ '@/views/home/my/index.vue'),
  }, {
    path: '/home/classify',
    name: 'classify',
    component: () => import(/* webpackChunkName: "classify" */ '@/views/home/classify/index.vue'),
  }]
}, {
  path: '/address',
  name: 'address',
  component: () => import(/* webpackChunkName: "address" */ '@/views/address/index.vue')
}, {
  path: '/add/address',
  name: 'addAddress',
  component: () => import(/* webpackChunkName: "addAddress" */ '@/views/addAddress/index.vue')
},
{
  path: '*',
  name: 'notMatch',
  component: () => import(/* webpackChunkName: "addAddress" */ '@/views/notMatch/404.vue')
}
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
